using SmartClientPlatform.RemoteClientBase;

namespace SmartClientPlatform.OMS.CommonLibrary
{
    public static class OrderExtentions
    {
        public static IScopeItem<Order> OrderID(this IScopeItem<Order> it)
        {
            return it.Field(_ => _.OrderID);
        }
        public static IScopeItem<Order> OrderDate(this IScopeItem<Order> it)
        {
            return it.Field(_ => _.OrderDate);
        }
        public static IScopeItem<Order> ShipDate(this IScopeItem<Order> it)
        {
            return it.Field(_ => _.ShipDate);
        }
        public static IScopeItem<OrderDetail> OrderDetails(this IScopeItem<Order> it)
        {
            return it.Rel(_ => _.OrderDetails);
        }
        public static IScopeItem<Customer> Customer(this IScopeItem<Order> it)
        {
            return it.Rel(_ => _.Customer);
        }
    }

    public static class OrderDetailExtentions
    {
        public static IScopeItem<OrderDetail> Price(this IScopeItem<OrderDetail> it)
        {
            return it.Field(_ => _.Price);
        }
        public static IScopeItem<OrderDetail> Quantity(this IScopeItem<OrderDetail> it)
        {
            return it.Field(_ => _.Quantity);
        }
        public static IScopeItem<Product> Product(this IScopeItem<OrderDetail> it)
        {
            return it.Rel(_ => _.Product);
        }
    }

    public static class ProductExtentions
    {
        public static IScopeItem<Product> Name(this IScopeItem<Product> it)
        {
            return it.Field(_ => _.Name);
        }
    }
}